package com.kingdee.eas.xr.app;

import javax.ejb.*;
import java.rmi.RemoteException;
import com.kingdee.bos.*;
import com.kingdee.bos.util.BOSObjectType;
import com.kingdee.bos.metadata.IMetaDataPK;
import com.kingdee.bos.metadata.rule.RuleExecutor;
import com.kingdee.bos.metadata.MetaDataPK;
//import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.framework.ejb.AbstractEntityControllerBean;
import com.kingdee.bos.framework.ejb.AbstractBizControllerBean;
//import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.IObjectCollection;
import com.kingdee.bos.service.ServiceContext;
import com.kingdee.bos.service.IServiceContext;
import com.kingdee.eas.framework.Result;
import com.kingdee.eas.framework.LineResult;
import com.kingdee.eas.framework.exception.EASMultiException;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;

import java.lang.String;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.basedata.org.OrgStructureInfo;
import java.util.Map;
import com.kingdee.bos.metadata.IMetaDataPK;
import java.util.Set;
import com.kingdee.eas.framework.bireport.util.SimpleTreeNode;
import java.sql.Timestamp;



public abstract class AbstractXrCommonFacadeControllerBean extends AbstractBizControllerBean implements XrCommonFacadeController
{
    protected AbstractXrCommonFacadeControllerBean()
    {
    }

    protected BOSObjectType getBOSType()
    {
        return new BOSObjectType("2AD59F5B");
    }

    public Set getAllParentOrgIds(Context ctx, String treeId, String orgUnitId) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("7bc855c8-32cf-473a-a7b2-3bf5d9731fa9"), new Object[]{ctx, treeId, orgUnitId});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            Set retValue = (Set)_getAllParentOrgIds(ctx, treeId, orgUnitId);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (Set)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract Set _getAllParentOrgIds(Context ctx, String treeId, String orgUnitId) throws BOSException, EASBizException;

    public String getOrgLongNumber(Context ctx, String treeId, String orgUnitId) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("4df4acbc-9360-44d7-9c0b-85c807ab0a65"), new Object[]{ctx, treeId, orgUnitId});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            String retValue = (String)_getOrgLongNumber(ctx, treeId, orgUnitId);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (String)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract String _getOrgLongNumber(Context ctx, String treeId, String orgUnitId) throws BOSException, EASBizException;

    public Set getChildrenOrgIds(Context ctx, String treeId, String orgUnitId) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("7da469e7-5d79-424c-a7b1-21fa0e1183b2"), new Object[]{ctx, treeId, orgUnitId});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            Set retValue = (Set)_getChildrenOrgIds(ctx, treeId, orgUnitId);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (Set)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract Set _getChildrenOrgIds(Context ctx, String treeId, String orgUnitId) throws BOSException, EASBizException;

    public String getParentOrgId(Context ctx, Set ids, String treeId) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("b3c0fa8d-576d-4d0c-9c02-52ee4c5b8842"), new Object[]{ctx, ids, treeId});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            String retValue = (String)_getParentOrgId(ctx, ids, treeId);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (String)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract String _getParentOrgId(Context ctx, Set ids, String treeId) throws BOSException, EASBizException;

    public String locateMetaSvr(Context ctx, String metaName) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("5800027a-97ee-45d0-9a1c-6741972d4b66"), new Object[]{ctx, metaName});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            String retValue = (String)_locateMetaSvr(ctx, metaName);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (String)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract String _locateMetaSvr(Context ctx, String metaName) throws BOSException, EASBizException;

    public String locateClassSvr(Context ctx, String className) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("78a8d79a-0c34-42c6-8da8-62ccb14c97ad"), new Object[]{ctx, className});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            String retValue = (String)_locateClassSvr(ctx, className);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (String)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract String _locateClassSvr(Context ctx, String className) throws BOSException, EASBizException;

    public Map beforeDownLoadClassOrJarFile(Context ctx, String className) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("b49f7657-cfaa-4005-bb33-03cdb523f4dc"), new Object[]{ctx, className});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            Map retValue = (Map)_beforeDownLoadClassOrJarFile(ctx, className);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (Map)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract Map _beforeDownLoadClassOrJarFile(Context ctx, String className) throws BOSException, EASBizException;

    public boolean afterDownLoadClassOrJarFile(Context ctx, String className) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("a92d5789-107c-4240-a86e-e7049cf8f8ba"), new Object[]{ctx, className});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            boolean retValue = (boolean)_afterDownLoadClassOrJarFile(ctx, className);
            svcCtx.setMethodReturnValue(new Boolean(retValue));
            }
            invokeServiceAfter(svcCtx);
            return ((Boolean)svcCtx.getMethodReturnValue()).booleanValue();
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract boolean _afterDownLoadClassOrJarFile(Context ctx, String className) throws BOSException, EASBizException;

    public Timestamp getServerDate(Context ctx) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("877daf4e-28f0-4ab2-9f74-3a344355e59f"), new Object[]{ctx});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            Timestamp retValue = (Timestamp)_getServerDate(ctx);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (Timestamp)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract Timestamp _getServerDate(Context ctx) throws BOSException;

    public void saveColorScheme(Context ctx, Map colorScheme, String bosType) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("cab5f441-31fa-470e-a13f-066c4cc407e7"), new Object[]{ctx, colorScheme, bosType});
            invokeServiceBefore(svcCtx);
              if(!svcCtx.invokeBreak()) {
            _saveColorScheme(ctx, colorScheme, bosType);
            }
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _saveColorScheme(Context ctx, Map colorScheme, String bosType) throws BOSException, EASBizException;

    public Map loadColorScheme(Context ctx, String bosType) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("82cad1ca-c953-4f6c-a266-0c67c44e7baa"), new Object[]{ctx, bosType});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            Map retValue = (Map)_loadColorScheme(ctx, bosType);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (Map)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract Map _loadColorScheme(Context ctx, String bosType) throws BOSException, EASBizException;

    public SimpleTreeNode getCompanyTree(Context ctx, String treeID, OrgStructureInfo rootInfo, IMetaDataPK metaDataPK, IMetaDataPK actionPK) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("d4a5d64c-421d-447e-a658-c70050be5c76"), new Object[]{ctx, treeID, rootInfo, metaDataPK, actionPK});
            invokeServiceBefore(svcCtx);
            if(!svcCtx.invokeBreak()) {
            SimpleTreeNode retValue = (SimpleTreeNode)_getCompanyTree(ctx, treeID, rootInfo, metaDataPK, actionPK);
            svcCtx.setMethodReturnValue(retValue);
            }
            invokeServiceAfter(svcCtx);
            return (SimpleTreeNode)svcCtx.getMethodReturnValue();
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract SimpleTreeNode _getCompanyTree(Context ctx, String treeID, OrgStructureInfo rootInfo, IMetaDataPK metaDataPK, IMetaDataPK actionPK) throws BOSException, EASBizException;

}